<template>
	<view>
		<u-list @scrolltolower="scrolltolower" v-if="MarketList.length != 0">
			<u-list-item v-for="(item, index) in MarketList" :key="index">
				<view class="baby_box">
					<view class="chanht">
						<view class="chanht_box">
							<image :src="imgUrl + item.monImage" mode=""></image>
							<view class="nodatapage_box">
								<view class="">Duck #{{ item.number }}</view>
								<view class="">
									{{ item.orderNo }}
								</view>
							</view>
						</view>
						<!-- 订单时间 -->
						<view class="time_box">
							<view class="">
								{{ item.payTime }}
							</view>
							<view class="price">
								售价：
								<text style="font-size: 26rpx">￥</text>
								<text>{{ item.price.toFixed(2)}}</text>
							</view>
						</view>
					</view>
				</view>
			</u-list-item>
		</u-list>
		<view v-if="MarketList.length == 0">
	<image style="
	width: 280rpx;
	height: 280rpx;
	margin: 170rpx 230rpx 0;
	" src="../../static/images/fighting.gif" mode=""></image>
		</view>
	</view>
</template>
<script>
	import {
		tMarket
	} from '@/api/hassold/hassold.js';
	import config from '@/config.js';
	export default {
		data() {
			return {
				page: 1,
				size: 10,
				totalSize: 0,
				MarketList: [],
				imgUrl: config.gillUrl
			};
		},
		created() {
			this.gettMarket();
		},
		methods: {
			async gettMarket() {
				let param = {};
				param.page = this.page;
				param.size = this.size;
				const data = await tMarket(param);
				// console.log(data,"ppp");
				this.totalSize = data.data.totalSize;
				let _this = this;
				data.data.pageData.map((i) => {
					_this.MarketList.push(i);
				});

			},
			scrolltolower() {
				//加载时候判断是否还有下一页
				if (this.MarketList.length < this.totalSize) {
					this.page++;
					//则还有下一页
					this.gettMarket();
				}
			}
		}
	};
</script>

<style lang="scss" scoped>
	.Abouts {
		width: 680rpx;
		margin: 300rpx 17rpx;
		padding-left: 8%;
	}

	.baby_box {
		padding: 34rpx 0 0 34rpx;

		.chanht {
			width: 680rpx;
			height: 250rpx;

			background: #15142D;
			border-radius: 14rpx;

			.chanht_box {
				padding: 20rpx;
				display: flex;

				image {
					width: 140rpx;
					height: 140rpx;
					border-radius: 14rpx;
				}

				.nodatapage_box {
					font-size: 26rpx;
					font-weight: 400;
					color: #ffffff;
					font-family: "font";
					margin-top: 30rpx;
					view {
						padding: 0 0 20rpx 30rpx;
					}

				}
			}

			.time_box {
				width: 650rpx;
				padding: 10rpx 0 0 20rpx;
				display: flex;
				justify-content: space-between;

				view {
					font-size: 26rpx;
					font-weight: 400;
					color: #ffffff;
					font-family: "font";
				}

				.price {
					color: #6b7280;
					margin-top: -10rpx;
				}

				text {
					color: #ffffff;
					font-size: 35rpx;
					font-weight: 800;
				}
			}
		}
	}
</style>